<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/headMain.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>用户管理</title>
  </head>
  		<script type="text/javascript">
		$(function() {
				$("#_userList").jqGrid({
				   	url: "${base}/user_getUserList",
					datatype: "json",
				   	colNames:['ID','用户名称','姓名','角色设置'],
				   	colModel:[
				   		{name:'id',index:'id', width:55, align:'center',hidden:true},
				   		{name:'regname', index:'regname', align:'center'},
				   		{name:'name', index:'name', align:'center'},
				   		{name:'rolesetup', index:'rolesetup', align:'center'},
				   	],
				   	width:_width_,
				   	height:230,
				   	rowNum:10,
				   	rowList:[10,20,30],
				   	pager: '#_userBar',
				   	sortname: 'id',
				    viewrecords: true,
				    sortorder: "desc",
					multiselect: false,
					jsonReader: {
						repeatitems : false
					},
					rownumbers : true,
					caption: "用户管理",
					afterInsertRow : function(rowid, data) {
						$("#_userList").jqGrid('setCell', rowid, 'rolesetup', '<span style="cursor:pointer;" onclick="_userSetupRole(' + data.id + ');">角色设置</span>', {color : 'purple'});
					}
				});
				$("#_userList").jqGrid('navGrid','#_userBar',{add : false, del : false, edit : false, refresh : true, search : false});
				jQuery.div.util.dialogInit("用户设置角色", "_userSetupRole", 950, 370);
		});
		function _userSetupRole(userId){
			//window.location.href="${base}/user_userSetupRole/"+userId;
			$('#_userSetupRole').dialog('open').load(jQuery.getBasePath() +'/user_userSetupRole/'+userId,function(){
				jQuery.div.util.hideLoading();
			});
		}
		</script>
	<body>
	<table cellpadding="0" cellspacing="0" border="0" width="99%" style="height:100%;">
		<tr><td style="height:10px; overflow:hidden;" colspan="2"></td></tr>
		<tr>
			<!--右边内容-->
			<td width="*" valign="top" class="contList">
				<!--<div id="_userManagerDiv">
					 显示用户列表 
						<table id="_userList"></table>
						<div id="_userBar"></div>
				</div>--> 
				<!-- begin -->
				<div id="_userManagerDiv">
						<div class="mainInfo">
							<div class="subScroll" id="subScroll"><!-- 滚动条 -->
								<div class="mainTable">
									<table id="_userList"></table><!-- 显示列表内容 -->
									<div id="_userBar"></div>
										<div class="minwidth_div"></div>
									</div>
								</div>
							</div>
						</div>
				</div>
				<!-- end  -->
			</td>
	</table>
	</body>
	<div id="_userSetupRole"></div><!-- 用户设置角色-->
</html>